From e6e99c4f9f9ff10ee12ed8a604e367dde3703053 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 6 Sep 2013 03:01:37 +0200 Subject: [PATCH] css: Change currentColor handling We now pass NULL when the current color should be the default value of the "color" property and we haven't looked up any value yet. This way we don't need to look it up all the time and more importantly we can resolve the default color, which is required because it's a GtkCssColorValue and not a GtkCssRgbaValue. Fixes assertions triggering at Polari startup. --- gtk/gtkcsscolorvalue.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gtk/gtkcsscolorvalue.c b/gtk/gtkcsscolorvalue.c index 9972d96a99..705e7a3a76 100644 --- a/gtk/gtkcsscolorvalue.c +++ b/gtk/gtkcsscolorvalue.c @@ -150,7 +150,6 @@ _gtk_css_color_value_resolve (GtkCssValue *color, g_return_val_if_fail (color != NULL, NULL); g_return_val_if_fail (provider == NULL || GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL); - g_return_val_if_fail (current != NULL, NULL); if (dependencies == NULL) dependencies = &unused; @@ -271,7 +270,12 @@ _gtk_css_color_value_resolve (GtkCssValue *color, } else { - return NULL; + return _gtk_css_color_value_resolve (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (GTK_CSS_PROPERTY_COLOR)), + provider, + NULL, + 0, + dependencies, + cycle_list); } break; default: @@ -320,7 +324,7 @@ gtk_css_value_color_compute (GtkCssValue *value, } else { - current = _gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (GTK_CSS_PROPERTY_COLOR)); + current = NULL; current_deps = 0; } } -- 2.30.2